package com.t216.dm216.controller;

import com.t216.dm216.common.Result;
import com.t216.dm216.pojo.DmItemType;
import com.t216.dm216.service.DmItemTypeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/item/api/p/type")
public class DmItemTypeController {
    @Resource
    private DmItemTypeService dmItemTypeService;
    @PostMapping("/queryItemType")
    public Result<List<DmItemType>> queryItemType(@RequestBody DmItemType dmItemType) {
        return Result.success(dmItemTypeService.getItemType(dmItemType.getParent()));
    }
}
